package com.assistant.service.impl;

import java.util.List;

import org.utils.Page;
import org.utils.PersistenceUtils;

import com.assistant.model.Message;
import com.assistant.service.MessageService;

public class MessageServiceImpl extends PersistenceUtils<Message, String> implements MessageService {

	public Page queryPage(Message message, Page page) {
		int start = Page.countOffset(page.getPageSize(), page.getCurrentPage());
		int allCount = super.count(message);
		List<Message> list = super.queryList(message, start, page.getPageSize());
		return Page.toPage(list, page.getCurrentPage(), page.getPageSize(), allCount);
	}

}
